<template>
   <h1>Hello Compositon ApI</h1>
  <h2>工资：{{ salary }}</h2>
  <button @click="addBtn(1000)">加油~加1000</button>
</template>

<script>
import { ref } from 'vue'
export default {
  name: 'HelloWorld',
  props: {
  
  },
    setup() {
    /* Vue3 推荐写法：组合式API */
    const salary = ref(8000)
    const addBtn = (val) => {
      salary.value += val
    }
    return { salary, addBtn }
  },
  data() {
    return {
    
    }
  }
}
</script>
